package pl.net.csrv.beans;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

/**
 * @author Maciek
 * 
 */
@Entity
@NamedQueries({ @NamedQuery(name = "FIND_USER_BY_LOGIN", query = "Select u from User u where u.login=:login") })
@Table(name = "Users")
public class User {

	/**
	 * Id
	 */
	@SequenceGenerator(name = "user_seq", sequenceName = "user_seq")
	@Id
	@GeneratedValue(generator = "user_seq", strategy = GenerationType.SEQUENCE)
	private Long id;

	/**
	 * Login
	 */
	@Column(name = "LOGIN")
	private String login;

	/**
	 * Password
	 */
	@Column(name = "PASSWORD")
	private String password;

	/**
	 * Active
	 */
	@Column(name = "ACTIVE")
	private Boolean active;

	/**
	 * Comment
	 */
	@Column(name = "U_COMMENT")
	private String comment;

	/**
	 * Encrypted password
	 */
	@Column(name = "ENC_PASSWD")
	private String encPasswd;

	/**
	 * Gets the id
	 * 
	 * @return the id Long
	 */
	public Long getId() {
		return id;
	}

	/**
	 * Sets the id
	 * 
	 * @param id
	 *            the id Long to set
	 */
	public void setId(Long id) {
		this.id = id;
	}

	/**
	 * Gets the login
	 * 
	 * @return the login String
	 */
	public String getLogin() {
		return login;
	}

	/**
	 * Sets the login
	 * 
	 * @param login
	 *            the login String to set
	 */
	public void setLogin(String login) {
		this.login = login;
	}

	/**
	 * Gets the password
	 * 
	 * @return the password String
	 */
	public String getPassword() {
		return password;
	}

	/**
	 * Sets the password
	 * 
	 * @param password
	 *            the password String to set
	 */
	public void setPassword(String password) {
		this.password = password;
	}

	/**
	 * Gets the active flag
	 * 
	 * @return the active Boolean
	 */
	public Boolean getActive() {
		return active;
	}

	/**
	 * Sets the active flag
	 * 
	 * @param active
	 *            the active Boolean to set
	 */
	public void setActive(Boolean active) {
		this.active = active;
	}

	/**
	 * Gets the comment
	 * 
	 * @return the String comment
	 */
	public String getComment() {
		return comment;
	}

	/**
	 * Sets the comment
	 * 
	 * @param comment
	 *            the String comment to set
	 */
	public void setComment(String comment) {
		this.comment = comment;
	}

	/**
	 * Gets the encPasswd
	 * 
	 * @return String
	 */
	public String getEncPasswd() {
		return encPasswd;
	}

	/**
	 * Sets the encPasswd
	 * 
	 * @param encPasswd
	 *            String
	 */
	public void setEncPasswd(String encPasswd) {
		this.encPasswd = encPasswd;
	}
}
